package com.example.minemodule.model;

import androidx.lifecycle.MutableLiveData;

import com.example.minemodule.entity.ProtocalEntity;
import com.example.minemodule.net.MineApiService;
import com.yilijk.base.base.BaseRepositoryImpl;
import com.yilijk.base.network.RequestParams;
import com.yilijk.base.network.bean.Resource;
import com.yilijk.base.network.core.RetrofitManager;
import com.yilijk.base.network.https.interceptor.NetWorkUtils;
import com.yilijk.base.utils.CommonUtils;

import org.json.JSONObject;

import java.util.HashMap;

import okhttp3.MediaType;
import okhttp3.RequestBody;
/**
 * Created by SHICHENG
 * on 2021/10/22.
 */
public class SettingModel extends BaseRepositoryImpl {

    //获取注册协议文案列表
    public MutableLiveData<Resource<ProtocalEntity.DataBean>> getProtocalEntity(String documentNo) {
        MutableLiveData<Resource<ProtocalEntity.DataBean>> liveData = new MutableLiveData<>();
        HashMap<String, Object> map = new HashMap<>();
        map.put("documentNo",documentNo);
        return observeGo(RetrofitManager.getRetrofitManager().getRetrofit().create(MineApiService.class).getProtocalEntity(map), liveData);
    }

    //获取注册协议文案列表
    public MutableLiveData<Resource<String>> getLogoutInfo(){
        MutableLiveData<Resource<String>> liveData = new MutableLiveData<>();
        RequestParams params = new RequestParams();
        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json;charset=UTF-8"), params.toString());
        return observeGo(RetrofitManager.getRetrofitManager().getRetrofit().create(MineApiService.class).getLogoutInfo(requestBody),liveData);
    }


}
